package com.kaigejava.guanchazhemoshi.observermodel;

import com.kaigejava.guanchazhemoshi.observermodel.interfaceObj.Observer;

/**
 * Created by kaigejava on 2019/8/12.
 * 实现了observer接口的另一个公告板(预测公告板)
 */
public class ForcastConditionSt implements Observer{
    /**
     * 温度
     */
    private float temperatrue;
    /**
     * 气压
     */
    private float pressure;
    /**
     * 湿度
     */
    private float humidity;
    /**
     * 天气更新
     * @param temperatrue
     * @param pressure
     * @param humidity
     */
    @Override
    public void updte(float temperatrue, float pressure, float humidity) {
        this.temperatrue = temperatrue;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }
    /**
     * 对外展示天气信息
     */
    public void display(){
        System.out.println("****天气预报：预计明日天气******");
        System.out.println("****预计明日温度："+temperatrue);
        System.out.println("****预计明日气压："+pressure);
        System.out.println("****预计明日湿度："+humidity);
    }
}
